<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center cashier_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub cashier_fd0_0'>
					<view class='flex flex-wrap align-center cashier_fd0_0_c0' @tap.stop="popupShow1715823668622=true">
						<text class='fu-iconfont2  cashier_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='cashier_fd0_0_c1'>支付订单</text>
					<view class='flex flex-wrap align-center cashier_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout cashier_flex_1">
				<view class='flex flex-wrap align-end justify-center cashier_fd1_0'>
					<text class='cashier_fd1_0_c0'>￥</text>
					<text class=' cashier_fd1_0_c1'>
						<text>{{ money | frontPrice }}</text>
						<text class=' cashier_price2_fd1_0_c1'>{{ money | laterPrice }}</text>
					</text>
				</view>
				<view class='flex flex-wrap align-center justify-center cashier_fd1_1' v-if="countdown && countdown > 0">
					<text class='cashier_fd1_1_c0'>支付剩余时间：</text>
					<benben-countdown class='cashier_fd1_1_c1' :show-day='false' :time-type='false'
						:count-time="countdown" @time-end="daojishi_endFunc()">
						<template #default="{ d, h, i, s }">
							<text class='cashier_fd1_1_c0'>{{h}}</text>

							<text class='cashier_fd1_1_c0'>:</text>

							<text class='cashier_fd1_1_c0'>{{i}}</text>

							<text class='cashier_fd1_1_c0'>:</text>

							<text class='cashier_fd1_1_c0'>{{s}}</text>

							<text class='cashier_fd1_1_c0'></text>
						</template>
					</benben-countdown>
				</view>
				<view class='flex flex-wrap align-center cashier_fd1_2'>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch cashier_fd1_3'>
					<text class='cashier_fd1_3_c0'>选择支付方式-lakla</text>
				</view>
				<benben-select-diy ref="showSelectPopup1702974557411"
						class-name='flex flex-direction flex-wrap align-stretch flex cashier_fd1_4' :items.sync="pay_type"
						v-model="pay_id" default-type="value" default-label="name" :allow-cancel='false' type="radio"
						:disabled='false'>
						<template v-for='(item,key0) in pay_type'>
							<view v-if="pay_id == item.value" class='flex align-center flex cashier_fd1_4_c0' :key="key0"
								@tap="$refs.showSelectPopup1702974557411.tapHandle(key0)">
								<image class='cashier_fd1_4_c0_c0' mode="aspectFill" :src='item.image'></image>
								<text class='cashier_fd1_4_c0_c1'>{{item.name}}</text>
								<view class='flex flex-wrap align-center' v-if=" item.value=='2'">
									<text class='cashier_fd1_4_c0_c2_c0'>（</text>
									<text class='cashier_fd1_4_c0_c2_c0'>余额可抵扣：</text>
									<text class='cashier_fd1_4_c0_c2_c0'>{{qianbao.user_money}}</text>
									<text class='cashier_fd1_4_c0_c2_c0'>）</text>
								</view>
								<image class='cashier_fd1_4_c0_c3' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
							</view>
							<view v-else class='flex align-center flex cashier_fd1_4_c0' :key="key0"
								@tap="$refs.showSelectPopup1702974557411.tapHandle(key0)">
								<image class='cashier_fd1_4_c0_c0' mode="aspectFill" :src='item.image'></image>
								<text class='cashier_fd1_4_c0_c1'>{{item.name}}</text>
								<view class='flex flex-wrap align-center' v-if=" item.value=='2'">
									<text class='cashier_fd1_4_c0_c2_c0'>（</text>
									<text class='cashier_fd1_4_c0_c2_c0'>余额可抵扣：</text>
									<text class='cashier_fd1_4_c0_c2_c0'>{{qianbao.user_money}}</text>
									<text class='cashier_fd1_4_c0_c2_c0'>）</text>
								</view>
								<image class='cashier_fd1_4_c0_c3' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
							</view>
						</template>
					</benben-select-diy>
			</view>
			<!---flex布局flex布局结束-->
		
			<benben-popup v-model="popupShow1715823668622" :mask="true" :mask-close-able="true" mode='center'>
				<!---离开收银台弹窗flex布局开始-->
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout cashier_flex_5">
					<text class='cashier_fd5_0'>确认离开收银台？</text>
					<!-- <text class='cashier_fd5_1'>确定要下架这个商品吗？</text> -->
					<view class='flex flex-wrap align-center'>
						<button class='cashier_fd5_2_c0' @tap.stop="handleJumpDiy" data-type="back"
							data-url="1">确认离开</button>
						<button class='cashier_fd5_2_c1' @tap.stop="popupShow1715823668622=false">继续支付</button>
					</view>
				</view>
				<!---离开收银台弹窗flex布局结束-->

			</benben-popup>
			
			<view class="flex flex-wrap align-start justify-center benben-position-layout flex cashier_flex_6">
				<button class='cashier_fd6_0' @tap.stop="postPayFunc()">立即支付</button>
			</view>

		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"pay_id": "1",
				"popupShow1715823668622": false,
				"money": "",
				"countdown": "",
				"order_sn": "",
				"pay_type": [{name:'微信支付',image:'https://yunshangxiaoyuans.oss-cn-beijing.aliyuncs.com/mini/images/164.png',value:'1'}],
			};
		},
		computed: {},
		watch: {},
		onLoad(options) {
			let {
				money,
				countdown,
				order_sn,
			} = options
			if (money !== undefined) this.money = money
			if (countdown !== undefined) this.countdown = countdown
			if (order_sn !== undefined) this.order_sn = order_sn
			
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//提交支付
			async postPayFunc() {
				let data67d931a677bc6 = await this.$api.dbPost(global.apiUrls.post67d931a677bc6, {
						order_sn: this.order_sn,
						paytype: 'LakalaPay',
						order_config_id: this.order_type
					});
					if (!data67d931a677bc6) return
					
					if (data67d931a677bc6.data.code == 2) {
						this.jumpPaySuccessFunc();
						return
					}
					if (data67d931a677bc6.data.code != 1) {
						this.$message.info(data67d931a677bc6.data.msg);
						return
					}
					let infodata67d931a677bc6 = data67d931a677bc6.data;
					this.payInfo = infodata67d931a677bc6.data
					await this.requestPaymentWx(this.payInfo)
					this.jumpPaySuccessFunc()
			},
						//倒计时结束事件
			daojishi_endFunc() {
				if (this.countdown == 0) {
					this.$urouter.navigateBack(1);
				}
			},
			//跳转不同支付成功页面
			jumpPaySuccessFunc() {
				this.$urouter.redirectTo(`/pages/inSchool/payResult/payResult?money=${this.money}&pay_id=${this.pay_id}&type=${this.type}`);
				// if (this.syccessType == '1') {

				// } else if (this.syccessType == '2') {

				// } else if (this.syccessType == '3') {

				// } else if (this.order_type == '18') {

				// } else if (this.order_type == '16') {

				// } else {

				// }
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.cashier_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.cashier_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.cashier_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.cashier_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.cashier_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.cashier_flex_1 {
		background: #fff;
		background-size: 100% auto !important;
		padding: 66rpx 0rpx 12rpx 0rpx;
	}

	.cashier_fd1_4_c0_c3 {
		width: 36rpx;
		height: 36rpx;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.cashier_fd1_4_c0_c2_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: var(--benbenFontColor5);
		line-height: 33rpx;
	}

	.cashier_fd1_4_c0_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
		line-height: 40rpx;
	}

	.cashier_fd1_4_c0_c0 {
		width: 56rpx;
		height: 56rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.cashier_fd1_4_c0 {
		padding: 20rpx 0rpx 20rpx 0rpx;
	}

	::v-deep .cashier_fd1_4 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.cashier_fd1_3_c0 {
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
		line-height: 45rpx;
	}

	.cashier_fd1_3 {
		border-bottom: 1px solid #eee;
		margin: 0rpx 32rpx 12rpx 32rpx;
		padding: 40rpx 0rpx 24rpx 0rpx;
	}

	.cashier_fd1_2 {
		background: rgba(246, 247, 249, 1);
		height: 20rpx;
		background-size: 100% auto;
	}

	.cashier_fd1_1_c1 {
		background: transparent;
	}

	.cashier_fd1_1_c0 {
		color: #999999;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.cashier_fd1_1 {
		color: #E60036;
		font-size: 28rpx;
		line-height: 48rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 56rpx 0rpx;
	}

	.cashier_price2_fd1_0_c1 {
		font-size: 32rpx;
	}

	.cashier_fd1_0_c1 {
		color: var(--benbenFontColor4);
		font-weight: 700;
		line-height: 77rpx;
		font-size: 64rpx;
	}

	.cashier_fd1_0_c0 {
		color: var(--benbenFontColor4);
		font-size: 32rpx;
		font-weight: 700;
		line-height: 81rpx;
	}

	.cashier_fd1_0 {
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.cashier_fd2_0_c2_c1 {
		background: #fff;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 33rpx;
		color: var(--benbenFontColor4);
		width: 269rpx;
		font-weight: 500;
		line-height: 94rpx;
	}

	.cashier_fd2_0_c2_c0 {
		border-right: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor2);
		line-height: 94rpx;
		width: 269rpx;
		font-weight: 400;
	}

	.cashier_fd2_0_c2 {
		border-top: 1px solid #eee;
	}

	.cashier_flex_password_noActive_fd2_0_c1 {
		border: 1px solid #ccc;
		width: 68rpx;
		height: 68rpx;
	}

	.cashier_flex_password_active_fd2_0_c1 {
		border: 1px solid #409EFF;
		width: 68rpx;
		height: 68rpx;
	}

	::v-deep .cashier_fd2_0_c1 {
		margin: 32rpx 0rpx 32rpx 0rpx;
	}

	.cashier_fd2_0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: rgba(51, 51, 51, 1);
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.cashier_fd2_0 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		background-size: 100% auto !important;
		padding: 40rpx 0rpx 0rpx 0rpx;
	}

	.cashier_flex_3 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.cashier_fd3_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor4);
		width: 265rpx;
	}

	.cashier_fd3_2_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 103rpx 0rpx 103rpx;
	}

	.cashier_fd3_2 {
		margin: 37rpx 0rpx 0rpx 0rpx;
	}

	.cashier_fd3_1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.cashier_fd3_0 {
		font-size: 36rpx;
		font-weight: 800;
		line-height: 44rpx;
		color: #333333;
		margin: 40rpx 0rpx 40rpx 0rpx;
	}

	.cashier_flex_4 {
		background: #fff;
		width: 540rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 40rpx 0rpx 0rpx 0rpx;
	}

	.cashier_fd4_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor4);
		width: 265rpx;
		height: 110rpx;
		line-height: 110rpx;
		font-weight: 500;
	}

	.cashier_fd4_2_c0 {
		border-top: 1px solid #eee;
		border-right: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(102, 102, 102, 1);
		width: 269rpx;
		height: 110rpx;
		line-height: 110rpx;
		font-weight: 500;
	}

	.cashier_fd4_2 {
		margin: 38rpx 0rpx 0rpx 0rpx;
	}

	.cashier_fd4_1_c0 {
		line-height: 52rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.cashier_fd4_0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		text-align: center;
		margin: 0rpx 0rpx 36rpx 0rpx;
	}

	.cashier_flex_5 {
		background: #fff;
		width: 540rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.cashier_fd5_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor4);
		width: 269rpx;
		height: 110rpx;
		line-height: 110rpx;
		font-weight: 500;
	}

	.cashier_fd5_2_c0 {
		border-top: 1px solid #eee;
		border-right: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		width: 269rpx;
		height: 110rpx;
		line-height: 110rpx;
		font-weight: 500;
	}

	.cashier_fd5_1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
		text-align: center;
		margin: 0rpx 0rpx 40rpx 0rpx;
	}

	.cashier_fd5_0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		text-align: center;
		margin: 40rpx 0rpx 40rpx 0rpx;
	}

	.cashier_flex_6 {
		width: 750rpx;
		height: 120rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.cashier_fd6_0 {
		background: var(--benbenbgColor0);
		border-radius: 40rpx;
		font-size: 32rpx;
		color: #fff;
		width: 686rpx;
		height: 80rpx;
		line-height: 80rpx;
		font-weight: 400;
	}
</style>
